import request from '../utils/http'

// let api = 'http://192.168.0.113:8081/'

// 权限
export function routerList (params) {
  return request({
    url: 'admin/module/list',
    method: 'get',
    data: params
  })
}

export function setPermission (params) {
  return request({
    url: 'admin/permission/alterPermission',
    method: 'post',
    data: params
  })
}

// 角色
export function roleList (params) {
  return request({
    url: 'admin/role/list',
    method: 'post',
    data: params
  })
}

export function addRole (params) {
  return request({
    url: 'admin/role/add',
    method: 'post',
    data: params
  })
}

export function changeRole (params) {
  return request({
    url: 'admin/role/alter',
    method: 'post',
    data: params
  })
}

export function delRole (params) {
  return request({
    url: 'admin/role/dele',
    method: 'post',
    data: params
  })
}

export function addUser (params) {
  return request({
    url: 'admin/user/add',
    method: 'post',
    data: params
  })
}

export function changeUser (params) {
  return request({
    url: 'admin/user/alter',
    method: 'post',
    data: params
  })
}

export function delUser (params) {
  return request({
    url: 'admin/user/dele',
    method: 'post',
    data: params
  })
}

export function rolePermission (params) {
  return request({
    url: 'admin/module/queryList',
    method: 'post',
    data: params
  })
}

export function adminList (params) {
  return request({
    url: 'admin/user/list',
    method: 'post',
    data: params
  })
}

// 菜单
export function menuList (params) {
  return request({
    url: 'admin/module/list',
    method: 'post',
    data: params
  })
}

// 日志
export function logList (params) {
  return request({
    url: 'admin/log/list',
    method: 'post',
    data: params
  })
}


// 登录
export function login (params) {
  return request({
    url: 'admin/user/login',
    method: 'post',
    data: params
  })
}

export function refreshToken (params) {
  return request({
    url: 'admin/user/refreshToken',
    method: 'post',
    data: params
  })
}

// 商家
export function businessList (params) {
  return request({
    url: 'shop/list',
    method: 'post',
    data: params
  })
}

export function checkBusiness (params) {
  return request({
    url: 'shop/audit',
    method: 'post',
    data: params
  })
}

export function industryList (params) {
  return request({
    url: 'shop/queryOnLineClassify',
    method: 'post',
    data: params
  })
}

export function businessInfoList (params) {
  return request({
    url: 'shop/queryInfo',
    method: 'post',
    data: params
  })
}

export function businessGoodsList (params) {
  return request({
    url: 'product/adminQueryList',
    method: 'post',
    data: params
  })
}

// 商品
export function goodsFunction (params) {
  return request({
    url: 'product/updateStatus',
    method: 'post',
    data: params
  })
}

export function goodsInfo (params) {
  return request({
    url: 'product/adminQueryProduct',
    method: 'post',
    data: params
  })
}

export function goodsEdit (params) {
  return request({
    url: 'product/add',
    method: 'post',
    data: params
  })
}

export function changEdit (params) {
  return request({
    url: 'shop/alter',
    method: 'post',
    data: params
  })
}

export function goodsAllFuc (params) {
  return request({
    url: 'product/adminUpdateStatus',
    method: 'post',
    data: params
  })
}

// 配置
export function bannerList (params) {
  return request({
    url: 'ads/getListAds',
    method: 'post',
    data: params
  })
}

export function addAds (params) {
  return request({
    url: 'ads/add',
    method: 'post',
    data: params
  })
}

// 删除banner
export function delBanner (params) {
  return request({
    url: 'ads/delAds',
    method: 'post',
    data: params
  })
}

export function changeAds (params) {
  return request({
    url: 'ads/update',
    method: 'post',
    data: params
  })
}

export function getConfigCode (params) {
  return request({
    url: 'ads/getList',
    method: 'post',
    data: params
  })
}

// 订单
export function orderList (params) {
  return request({
    url: 'order/adminQueryList',
    method: 'post',
    data: params
  })
}

export function orderFunc (params) {
  return request({
    url: 'order/updateStatus',
    method: 'post',
    data: params
  })
}

export function orderDel (params) {
  return request({
    url: 'order/adminQueryDetail',
    method: 'post',
    data: params
  })
}


// 养老金
export function pensionList (params) {
  return request({
    url: 'pension/getPensionByOrder',
    method: 'post',
    data: params
  })
}

export function pensionApplyList (params) {
  return request({
    url: 'pension/getApplyList',
    method: 'post',
    data: params
  })
}

export function pensionGotList (params) {
  return request({
    url: 'pension/getWithdrawDetail',
    method: 'post',
    data: params
  })
}
// 用户
export function userList (params) {
  return request({
    url: 'app/user/list',
    method: 'post',
    data: params
  })
}

export function userFunction (params) {
  return request({
    url: 'app/user/editUser',
    method: 'post',
    data: params
  })
}

// 统计
export function goodsDataList (params) {
  return request({
    url: 'product/num/statistics',
    method: 'post',
    data: params
  })
}

export function userDataList (params) {
  return request({
    url: 'app/user/userStats',
    method: 'post',
    data: params
  })
}

export function agentDataList (params) {
  return request({
    url: 'admin/user/userStats',
    method: 'post',
    data: params
  })
}

export function orderDataList (params) {
  return request({
    url: 'order/orderStatistics',
    method: 'post',
    data: params
  })
}

export function shopDataList (params) {
  return request({
    url: 'shop/stats',
    method: 'post',
    data: params
  })
}

export function pensionDataList (params) {
  return request({
    url: 'pension/getPensionByAllDls',
    method: 'post',
    data: params
  })
}


// 查询商品分类列表
export function queryGoodsClassify (params) {
  return request({
    url: 'tag/adminQueryList',
    method: 'post',
    data: params
  })
}

// 删除商品分类
export function delGoodsClassify (params) {
  return request({
    url: 'tag/delete',
    method: 'post',
    data: params
  })
}

// 添加商品分类
export function saveGoodsClassify (params) {
  return request({
    url: 'tag/save',
    method: 'post',
    data: params
  })
}

// 财务
export function moneyShopList (params) {
  return request({
    url: 'order/getShopYsMoneys',
    method: 'post',
    data: params
  })
}

export function moneyPlatList (params) {
  return request({
    url: 'order/getShopPtMoneys',
    method: 'post',
    data: params
  })
}

export function moneyAgentList (params) {
  return request({
    url: 'order/getSumMoneyByAgentSy',
    method: 'post',
    data: params
  })
}

// 代理商管理
export function agentPlatList (params) {
  return request({
    url: 'admin/user/agentList',
    method: 'post',
    data: params
  })
}

// 活动
export function activityList (params) {
  return request({
    url: 'preferential/adminQueryList',
    method: 'post',
    data: params
  })
}

export function addActivity (params) {
  return request({
    url: 'preferential/save',
    method: 'post',
    data: params
  })
}

export function changeActivity (params) {
  return request({
    url: 'preferential/update',
    method: 'post',
    data: params
  })
}

export function delActivity (params) {
  return request({
    url: 'preferential/delete',
    method: 'post',
    data: params
  })
}

export function seeGoods (params) {
  return request({
    url: 'preferential/adminQueryDetail',
    method: 'post',
    data: params
  })
}

export function goodsVisible (params) {
  return request({
    url: 'preferential/addProduct',
    method: 'post',
    data: params
  })
}

export function changeGoods (params) {
  return request({
    url: 'product/queryProductForPreferential',
    method: 'post',
    data: params
  })
}

export function isOpen (params) {
  return request({
    url: 'preferential/updateIsOpen',
    method: 'post',
    data: params
  })
}


// 意见反馈
export function opinionList (params) {
  return request({
    url: 'opinion/query',
    method: 'post',
    data: params
  })
}

export function doOpinion (params) {
  return request({
    url: 'opinion/comment',
    method: 'post',
    data: params
  })
}

// 修改商品分类  0关闭 1开启
export function alterGoodsClassify(params) {
  return request({
    url: 'tag/update',
    method: 'post',
    data: params
  })
}


// 获取地区列表
export function queryAddress() {
  return request({
    url: 'address/queryWebAddress',
    method: 'post'
  })
}



// export const addUser = params => { return axios.get(`${base}/user/add`, { params: params }) }



